<template>
  <router-view></router-view>
</template>

<script setup>
import '@/assets/global.css'
import {useStore} from "vuex";
import {onMounted} from "vue";
import request from "@/utils/request.js";

const store = useStore()
onMounted(async () => {
  await store.dispatch('getUserInfo')
  navigator.geolocation.getCurrentPosition(res => {
    const location = `${res.longitude},${res.latitude}`
    request.post(`/user/setLocation?location=${location}`)
    console.log(res)
  }, error => {
    console.log(error)
  })
})
</script>

<style>
</style>